VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{81F89158-F563-4F45-B990-BF16A35485CC}#1.0#0"; "DockControl.ocx"
Begin VB.MDIForm MiniERPMain 
   BackColor       =   &H8000000C&
   Caption         =   "Mini ERP Main"
   ClientHeight    =   8100
   ClientLeft      =   225
   ClientTop       =   255
   ClientWidth     =   10545
   Icon            =   "MiniERPMain.frx":0000
   LinkTopic       =   "MDIForm1"
   LockControls    =   -1  'True
   StartUpPosition =   2  'CenterScreen
   Begin VB.PictureBox Container 
      Align           =   4  'Align Right
      BackColor       =   &H80000003&
      Height          =   7485
      Left            =   2775
      ScaleHeight     =   7425
      ScaleWidth      =   7710
      TabIndex        =   2
      Top             =   330
      Width           =   7770
      Begin MSComctlLib.TabStrip tsMainTab 
         Height          =   330
         Left            =   300
         TabIndex        =   3
         Top             =   0
         Width           =   7395
         _ExtentX        =   13044
         _ExtentY        =   582
         Style           =   1
         ImageList       =   "imgApp"
         _Version        =   393216
         BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
            NumTabs         =   1
            BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               ImageVarType    =   2
            EndProperty
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin MSComCtl2.FlatScrollBar VBar 
         Height          =   6795
         Left            =   0
         TabIndex        =   4
         Top             =   345
         Width           =   285
         _ExtentX        =   503
         _ExtentY        =   11986
         _Version        =   393216
         LargeChange     =   2
         Max             =   100
         Orientation     =   1179648
      End
      Begin MSComCtl2.FlatScrollBar HBar 
         Height          =   285
         Left            =   285
         TabIndex        =   5
         Top             =   7140
         Width           =   7410
         _ExtentX        =   13070
         _ExtentY        =   503
         _Version        =   393216
         Arrows          =   65536
         LargeChange     =   2
         Max             =   100
         Orientation     =   1179649
      End
      Begin VB.PictureBox Workspace 
         BackColor       =   &H00FFFFFF&
         Height          =   6795
         Left            =   285
         ScaleHeight     =   6735
         ScaleWidth      =   7365
         TabIndex        =   6
         Top             =   345
         Width           =   7425
      End
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   285
      Left            =   0
      TabIndex        =   1
      Top             =   7815
      Width           =   10545
      _ExtentX        =   18600
      _ExtentY        =   503
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   5
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   6
            TextSave        =   "11/15/2011"
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   5
            TextSave        =   "12:25 AM"
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Enabled         =   0   'False
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Enabled         =   0   'False
         EndProperty
         BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Enabled         =   0   'False
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar tbMain 
      Align           =   1  'Align Top
      Height          =   330
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   10545
      _ExtentX        =   18600
      _ExtentY        =   582
      ButtonWidth     =   609
      ButtonHeight    =   582
      Style           =   1
      ImageList       =   "imgList"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   26
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "New"
            Object.ToolTipText     =   "New Record"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Edit"
            Object.ToolTipText     =   "Edit Record"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Delete"
            Object.ToolTipText     =   "Delete Record"
            ImageIndex      =   3
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Save"
            Object.ToolTipText     =   "Save Record"
            ImageIndex      =   4
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Undo"
            Object.ToolTipText     =   "Undo"
            ImageIndex      =   5
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Find"
            Object.ToolTipText     =   "Find Record"
            ImageIndex      =   6
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Print"
            Object.ToolTipText     =   "Print Record"
            ImageIndex      =   7
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Close"
            Object.ToolTipText     =   "Close Window"
            ImageIndex      =   8
         EndProperty
         BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "First"
            Object.ToolTipText     =   "Move to First Record"
            ImageIndex      =   9
         EndProperty
         BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Previous"
            Object.ToolTipText     =   "Move to Previous Record"
            ImageIndex      =   10
         EndProperty
         BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Next"
            Object.ToolTipText     =   "Move to Next Record"
            ImageIndex      =   11
         EndProperty
         BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Last"
            Object.ToolTipText     =   "Move to Last Record"
            ImageIndex      =   12
         EndProperty
         BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button18 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "New Line"
            Object.ToolTipText     =   "Add New Line"
            ImageIndex      =   13
         EndProperty
         BeginProperty Button19 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Delete Line"
            Object.ToolTipText     =   "Delete Line"
            ImageIndex      =   14
         EndProperty
         BeginProperty Button20 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button21 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Approve"
            Object.ToolTipText     =   "Approve Record"
            ImageIndex      =   15
         EndProperty
         BeginProperty Button22 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Reject"
            Object.ToolTipText     =   "Reject Record"
            ImageIndex      =   16
         EndProperty
         BeginProperty Button23 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Untag"
            Object.ToolTipText     =   "Untag Record"
            ImageIndex      =   17
         EndProperty
         BeginProperty Button24 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button25 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Toolbox"
            Object.ToolTipText     =   "Toolbox"
            ImageIndex      =   19
         EndProperty
         BeginProperty Button26 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Favorites"
            Object.ToolTipText     =   "Favorites"
            ImageIndex      =   20
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ImageList imgApp 
      Left            =   -15
      Top             =   930
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   4
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":0B02
            Key             =   "Application"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":1514
            Key             =   "Reports"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":1F26
            Key             =   "Settings"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":2938
            Key             =   "Others"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ImageList imgList 
      Left            =   570
      Top             =   930
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   20
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":334A
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":3D5C
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":476E
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":5180
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":5B92
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":65A4
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":6FB6
            Key             =   ""
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":79C8
            Key             =   ""
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":83DA
            Key             =   ""
         EndProperty
         BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":8DEC
            Key             =   ""
         EndProperty
         BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":97FE
            Key             =   ""
         EndProperty
         BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":A210
            Key             =   ""
         EndProperty
         BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":AC22
            Key             =   ""
         EndProperty
         BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":B734
            Key             =   ""
         EndProperty
         BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":C146
            Key             =   ""
         EndProperty
         BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":CB58
            Key             =   ""
         EndProperty
         BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":D56A
            Key             =   ""
         EndProperty
         BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":DF7C
            Key             =   ""
         EndProperty
         BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":E98E
            Key             =   ""
         EndProperty
         BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "MiniERPMain.frx":F3A0
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin DockControl.FormDock FDock 
      Left            =   1200
      Top             =   975
      _ExtentX        =   847
      _ExtentY        =   847
   End
   Begin VB.Menu mnuControls 
      Caption         =   "Controls"
      Visible         =   0   'False
      Begin VB.Menu mnuNew 
         Caption         =   "New"
         Shortcut        =   ^N
      End
      Begin VB.Menu mnuEdit 
         Caption         =   "Edit"
         Shortcut        =   ^E
      End
      Begin VB.Menu mnuDelete 
         Caption         =   "Delete"
         Shortcut        =   ^D
      End
      Begin VB.Menu mnuSep1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuSave 
         Caption         =   "Save"
         Shortcut        =   ^S
      End
      Begin VB.Menu mnuUndo 
         Caption         =   "Undo"
         Shortcut        =   ^Z
      End
      Begin VB.Menu mnuSep2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFind 
         Caption         =   "Find"
         Shortcut        =   ^F
      End
      Begin VB.Menu mnuPrint 
         Caption         =   "Print"
         Shortcut        =   ^P
      End
      Begin VB.Menu mnuSep3 
         Caption         =   "-"
      End
      Begin VB.Menu mnuClose 
         Caption         =   "Window Close"
         Shortcut        =   ^{F4}
      End
      Begin VB.Menu mnuSep4 
         Caption         =   "-"
      End
      Begin VB.Menu mnuMFirst 
         Caption         =   "Move First"
         Shortcut        =   +^{F1}
      End
      Begin VB.Menu mnuMPrev 
         Caption         =   "Move Previous"
         Shortcut        =   +^{F2}
      End
      Begin VB.Menu mnuMNext 
         Caption         =   "Move Next"
         Shortcut        =   +^{F3}
      End
      Begin VB.Menu mnuMLast 
         Caption         =   "Move Last"
         Shortcut        =   +^{F4}
      End
      Begin VB.Menu mnuSep5 
         Caption         =   "-"
      End
      Begin VB.Menu mnuPopupDetail 
         Caption         =   "Pop up"
         Begin VB.Menu mnuAddDetail 
            Caption         =   "Add Detail"
            Shortcut        =   +{INSERT}
         End
         Begin VB.Menu mnuRemoveDetail 
            Caption         =   "Remove Detail"
            Shortcut        =   +{DEL}
         End
      End
      Begin VB.Menu mnuSep6 
         Caption         =   "-"
      End
      Begin VB.Menu mnuApprove 
         Caption         =   "Approve"
         Shortcut        =   {F11}
      End
      Begin VB.Menu mnuReject 
         Caption         =   "Reject"
         Shortcut        =   {F12}
      End
      Begin VB.Menu mnuUntag 
         Caption         =   "Untag"
         Shortcut        =   ^{F5}
      End
   End
   Begin VB.Menu mnuPopup 
      Caption         =   "Popup"
      Visible         =   0   'False
      Begin VB.Menu mnuDockable 
         Caption         =   "Dockable"
      End
      Begin VB.Menu mnuHide 
         Caption         =   "Hide"
      End
   End
End
Attribute VB_Name = "MiniERPMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sBit() As Boolean
Dim nTemp As Integer

Private Sub FDock_FormHide(ByVal DockedForm As DockControl.TDockForm)
    Call MDIForm_Resize
End Sub

Private Sub FDock_PanelResize(ByVal Panel As DockControl.TTabDockHost)
    Call MDIForm_Resize
End Sub

Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If Not (FrmName Is Nothing) Then
        MsgBox "There are Active form(s)... Unable to exit application.", vbCritical, "Application"
        Cancel = -1
    End If
End Sub

Private Sub mnuAddDetail_Click()
    ButtonShortcut "New Line"
End Sub

Private Sub mnuApprove_Click()
    ButtonShortcut "Approve"
End Sub

Private Sub mnuClose_Click()
    ButtonShortcut "Close"
End Sub

Private Sub mnuDelete_Click()
    ButtonShortcut "Delete"
End Sub

Private Sub mnuEdit_Click()
    ButtonShortcut "Edit"
End Sub

Private Sub mnuFind_Click()
    ButtonShortcut "Find"
End Sub

Private Sub mnuMFirst_Click()
    ButtonShortcut "First"
End Sub

Private Sub mnuMLast_Click()
    ButtonShortcut "Last"
End Sub

Private Sub mnuMNext_Click()
    ButtonShortcut "Next"
End Sub

Private Sub mnuMPrev_Click()
    ButtonShortcut "Previous"
End Sub

Private Sub mnuNew_Click()
    ButtonShortcut "New"
End Sub

Private Sub mnuPrint_Click()
    ButtonShortcut "Print"
End Sub

Private Sub mnuReject_Click()
    ButtonShortcut "Reject"
End Sub

Private Sub mnuRemoveDetail_Click()
    ButtonShortcut "Delete Line"
End Sub

Private Sub mnuSave_Click()
    ButtonShortcut "Save"
End Sub

Private Sub mnuUndo_Click()
    ButtonShortcut "Undo"
End Sub

Private Sub mnuUntag_Click()
    ButtonShortcut "Untag"
End Sub

Private Sub FDock_FormDocked(ByVal DockedForm As DockControl.TDockForm)
    On Error GoTo ErrHandler
    Call MDIForm_Resize
    LoadDynamicForm FrmName, Workspace
ErrHandler:
End Sub

Private Sub FDock_FormUnDocked(ByVal DockedForm As DockControl.TDockForm)
    On Error GoTo ErrHandler
    Call MDIForm_Resize
    LoadDynamicForm FrmName, Workspace
ErrHandler:
End Sub

Private Sub FDock_CaptionClick(ByVal DockedForm As DockControl.TDockForm, ByVal Button As Integer, ByVal X As Single, ByVal Y As Single)
    If Button <> vbRightButton Then Exit Sub
    mnuPopup.Tag = DockedForm.Key
    mnuDockable.Enabled = (DockedForm.Style And tdDockFloat)
    mnuDockable.Checked = (DockedForm.State = tdDocked)
    PopupMenu mnuPopup
End Sub

Private Sub MDIForm_Load()
    GetAccessLevel tbMain, sUserRole, Me.Name, sBit
    tsMainTab.Tabs.Clear
    
    LoadDynamicForm frmStartUp, Workspace
    MainTab Add
    
    With FDock
        .GrabMain Me.hwnd
        .AddForm frmToolsLibrary, tdDocked, tdAlignLeft, frmToolsLibrary.Name, tdDockLeft Or tdDockFloat
        '.AddForm frmToolsFavorites, tdDocked, tdAlignLeft, frmToolsFavorites.Name, tdDockLeft Or tdDockFloat
        .Panels(tdAlignLeft).Width = 3500
        .Show
    End With
    
    RPTPath = App.Path & "\" & GetValFrTable("cValue", "System_Settings", "cCode='RPTPath'")
    
End Sub

Private Sub MDIForm_Resize()
    On Error GoTo ErrHandler
    If Me.Width <= 11220 Then
        Me.Width = 11220
    End If
    If Me.Height <= 8670 Then
        Me.Height = 8670
    End If
    
    tsMainTab.Width = MiniERPMain.Width
    If (FDock.Panels(tdAlignLeft).WindowList.Count <> 0) And (FDock.DockedForms(1).Visible) Then
        Container.Width = Me.Width - FDock.Panels(tdAlignLeft).Width - 200
    Else
        Container.Width = Me.Width - 200
    End If
    VBar.Height = Container.Height - HBar.Height - tsMainTab.Height - 75
    HBar.Move VBar.Width, Container.Height - HBar.Height - 75, Container.Width - VBar.Width - 75
    tsMainTab.Width = Container.Width - 300
    ResizeChild FrmName, Workspace
ErrHandler:
End Sub

Private Sub tbMain_ButtonClick(ByVal Button As MSComctlLib.Button)
    ButtonShortcut Button.Key
End Sub

Private Sub tsMainTab_Click()
    Dim i As Integer
    Dim lFind As Boolean
    On Error GoTo ErrHandler
    
    For Each oTempFrm In Forms
        If oTempFrm.Name = tsMainTab.Tabs(tsMainTab.SelectedItem.Index).Key Then
            Set FrmName = oTempFrm
            FrmName.TBReload
            ResizeChild FrmName, Workspace
            lFind = True
        End If
    Next
    
    If rs.State = 1 Then rs.Close
    rs.Open "se_LibraryList '" & sUserRole & "','ALL'", cn, adOpenStatic, adLockReadOnly
    
    If lFind = False Then
        For i = 1 To rs.RecordCount
            If rs!cDesc = tsMainTab.Tabs(tsMainTab.SelectedItem.Index).Caption Then
                LinkForms rs!cLink
                ResizeChild FrmName, Workspace
                Exit For
            End If
            rs.MoveNext
        Next i
    End If
    
ErrHandler:
    If Err.Number = 91 Then
        Set FrmName = Nothing
    End If
End Sub

'---------------------------------------------------------------------------------------------------------------------------------------------------
'Popup Procedures--------------------------------------------------------------------------------------------------------------------------
'---------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub mnuDockable_Click()
    If FDock.DockedForms(mnuPopup.Tag).State = tdDocked Then
        FDock.FormUndock mnuPopup.Tag
    Else
        FDock.FormDock mnuPopup.Tag
    End If
End Sub

Private Sub mnuHide_Click()
    FDock.FormHide mnuPopup.Tag
End Sub

'---------------------------------------------------------------------------------------------------------------------------------------------------
'Private Functions and Procedures-----------------------------------------------------------------------------------------------------
'---------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub ButtonShortcut(sStr As String)
    Select Case sStr
        Case "New"
            FrmName.TBNew
        Case "Edit"
            FrmName.TBEdit
        Case "Delete"
            FrmName.TBDelete
        Case "Save"
            FrmName.TBSave
        Case "Undo"
            FrmName.TBUndo
        Case "Find"
            FrmName.TBFind
        Case "Print"
            FrmName.TBPrint
        Case "Close"
            MainTab Remove
            tsMainTab_Click
        Case "First"
            FrmName.TBFirst
        Case "Previous"
            FrmName.TBPrevious
        Case "Next"
            FrmName.TBNext
        Case "Last"
            FrmName.TBLast
        Case "New Line"
            FrmName.TBNewLine
        Case "Delete Line"
            FrmName.TBDeleteLine
        Case "Approve"
            FrmName.TBApprove
        Case "Reject"
            FrmName.TBReject
        Case "Untag"
            FrmName.TBUntag
        Case "Toolbox"
            FDock.FormShow 1
        Case "Favorites"
            FDock.FormShow 2
    End Select
End Sub
 
Private Sub VBar_Change()
'    'FrmName.Top = FrmName.Top - VBar.Value
'    nTemp = VBar.Value
'    If nTemp = 0 Then
'        Workspace.Top = 345
'    ElseIf nTemp > VBar.Value Then
'        Workspace.Top = Workspace.Top - VBar.Value
'    Else
'        Workspace.Top = Workspace.Top + VBar.Value
'    End If
    If VBar.Value = 0 Then
        Workspace.Top = 345
     Else
        Workspace.Top = (VBar.Value * 10) - 345
    End If
End Sub

Private Sub VBar_Scroll()
    'FrmName.Top = FrmName.Top - VBar.Value
    nTemp = VBar.Value
    If nTemp = 0 Then
        Workspace.Top = 345
    ElseIf nTemp > VBar.Value Then
        Workspace.Top = Workspace.Top - VBar.Value
    Else
        Workspace.Top = Workspace.Top + VBar.Value
    End If
End Sub
